<template>
    <div class="header">
        <div class="header-logo">
            <img alt="Vue logo" src="../../assets/logo.png" @click="changeCollapse">
        </div>
        <div class="header-user">
            <div class="user-icon">
                <img src="../../assets/logo.png">
                <span class="user-name">土家肸哥</span>
            </div>
            <div class="message-icon">
                <el-badge :value="msgCount" :max="99">
                    <i class="el-icon-bell" title="我的消息"></i>
                </el-badge>
            </div>
            <div class="logout" @click="loginout"><i class="el-icon-switch-button"></i></div>
        </div>
    </div>
</template>

<script>
import bus from '@/utils/eventBus.js';
export default {
    data() {
        return {
            collapse: false,
            msgCount:0
        }
    },
    methods: {
        changeCollapse(){
            this.collapse = !this.collapse;
            bus.$emit('collapse', this.collapse);
        },
        loginout(){}
    },
}
</script>

<style lang="less">
    .header{
        width: 100%;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 9;
        background-color: #fff;
        .header-logo{
            img{
                width: 210px;
                height: 70px;
            }
        }
        .header-user{
            display: flex;
            align-items: center;
            padding-right: 20px;
            .user-icon{
                display: flex;
                align-items: center;
                img{
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                }
                span{
                    margin-left: 6px;
                }
            }
            .message-icon{
                margin: 0 10px;
                i{
                    font-size: 24px;
                    color: #000;
                    cursor: pointer;
                }
            }
            .logout{
                i{
                    font-size: 24px;
                    color: #000;
                    cursor: pointer;
                }
            }
        }
    }
</style>